package operation;

import book.Book;
import book.BookList;

import java.util.Scanner;

public class Add implements IOperation{
    @Override
    public void work(BookList bookList) {
        System.out.println("add book");
        Scanner scanner = new Scanner(System.in);
        System.out.print("input the name of the book you want to add");
        String name = scanner.nextLine();
        System.out.print("input the name of the author");
        String author = scanner.nextLine();
        System.out.print("input the price of the book you want to add");
        int price = scanner.nextInt();
        System.out.print("input the type of the book you want to add");
        String type = scanner.next();
        Book book = new Book(name,author,price,type);
        bookList.setBook(book);
        bookList.setBookNum(bookList.getBookNum() + 1);
        System.out.println("added successfully");

    }
}
